package cn.dnui_zll731.dnuifood_731zlll.Adapter;

import android.content.Context;
import android.support.v7.widget.RecyclerView;
import android.view.View;
import android.widget.TextView;
import java.util.List;
import cn.dnui_zll731.dnuifood_731zlll.R;
import cn.dnui_zll731.dnuifood_731zlll.bean.CommentsBean;
public class FoodInfoAdapter extends RecyclerViewAdapter<FoodInfoAdapter.ViewHolder>{


    public FoodInfoAdapter(Context context, List data, int layoutResource) {
        super(context, data, layoutResource);
    }

    @Override
    public void onBindViewHolder(ViewHolder holder, int position) {
        final CommentsBean commentsBean=(CommentsBean)data.get(position);
        if (commentsBean == null)
            return;
        holder.username.setText(commentsBean.getUsername());
        holder.infotime.setText(commentsBean.getOrder_time());
        holder.pinglun.setText(commentsBean.getContent());
    }

    public static class ViewHolder extends RecyclerView.ViewHolder {
        TextView username,infotime,pinglun;

        public ViewHolder(View itemView) {
            super(itemView);
            username=itemView.findViewById(R.id.info_username);
            infotime=itemView.findViewById(R.id.info_time);
            pinglun=itemView.findViewById(R.id.info_pinglun);
        }
    }
}
